<!DOCTYPE html>
<html lang="en" data-controller="<%= controller_name %>" data-action="<%= action_name %>">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title><%= [Shipit.app_name, @stack.try!(:repo_name)].compact.join(' - ') %></title>

    <%= favicon_link_tag %>
    <%= stylesheet_link_tag :shipit_bs, media: 'all' %>
    <%= javascript_include_tag :shipit_bs %>

    <%= csrf_meta_tags %>
  </head>
  <body>
    <% flash.each do |name, msg| %>
      <%= content_tag :div, msg, class: ["flash-#{name}", :flash] %>
    <% end %>

    <nav class="navbar navbar-fixed-top navbar-light bg-faded">
      <%= link_to "Shipit", root_path, class: "navbar-brand" %>

      <ul class="nav navbar-nav">
        <li class="nav-item active">
          <%= link_to "#", class: "nav-link" do %>
            <%= yield :page_title %>
          <% end %>
        </li>
      </ul>

      <div class="pull-xs-right">
        <%= link_to "Shipit v#{Shipit::VERSION}", "https://github.com/Shopify/shipit-engine/tree/v#{Shipit::VERSION}" %>
      </div>

      <div class="container pull-xs-right">
        <%= yield :primary_navigation %>
      </div>
    </nav>

    <div class="main">
      <%= yield %>
    </div>
  </body>
</html>
